/**
 * 
 */
package com.eagle.coders.reporting.engine.utils;

import java.io.File;
import java.util.Iterator;
import java.util.Map;

//import org.apache.tools.ant.BuildException;
//import org.apache.tools.ant.DirectoryScanner;
//import org.apache.tools.ant.taskdefs.MatchingTask;
//import org.apache.tools.ant.types.Resource;
//import org.apache.tools.ant.types.resources.FileResource;
//import org.apache.tools.ant.util.RegexpPatternMapper;
//import org.apache.tools.ant.util.SourceFileScanner;

/**
 * @author Anees
 *
 */
public class ReportScanTask { 
//extends MatchingTask {
	
//	public void scanSrc() throws BuildException	{
//		
//		for(Iterator it = src.iterator(); it.hasNext();)
//		{
//			Resource resource = (Resource)it.next();
//			FileResource fileResource = resource instanceof FileResource ? (FileResource)resource : null;
//			if (fileResource != null)
//			{
//				File file = fileResource.getFile();
//				if (file.isDirectory())
//				{
//					DirectoryScanner ds = getDirectoryScanner(file);
//					String[] files = ds.getIncludedFiles();
//					
//					scanDir(file, destdir != null ? destdir : file, files);
//				}
//				else
//				{
//					String[] files = new String[]{fileResource.getName()};
//
//					scanDir(fileResource.getBaseDir(), destdir != null ? destdir : fileResource.getBaseDir(), files);
//				}
//			}
////			else
////			{
////				//FIXME what to do?
////			}
//		}
//	}

//	/**
//	 * 
//	 * @param sourcePath
//	 * @return
//	 */
//	public Map<String, String> scanReportSourcePath(final String sourcePath){
//		
//		RegexpPatternMapper mapper = new RegexpPatternMapper();
//		mapper.setFrom("^(.*)\\.(.*)$");
//		mapper.setTo("\\1.jasper");
//		
//		SourceFileScanner scanner = new SourceFileScanner(ReportScanTask.this);
////		String[] newFiles = scanner.restrict(files, srcdir, destdir, mapper);
//		
//		return null;
//	}
}
